/* eslint-disable @typescript-eslint/no-explicit-any */
import type { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'

export interface MergeClo {
  mergeFirstColIndex: number
  colLen: number
}
export interface Merge {
  row?: any[]
  col?: MergeClo
}
export interface MergeParams {
  col?: string[]
  row?: string[]
}
export interface InitData {
  [propName: string]: any
}
export interface FilterVal {
  text: string
  value: string
}
export interface Search {
  align: string
  placeholder?: string
  size?: string
}
export interface StaticColumn {
  type: string
  width: number | string
  fixed?: string | boolean
  align?: string
}
export interface Header {
  label: string
  prop?: string
  width?: number | string
  fixed?: boolean | string
  sort?: boolean
  search?: Search
  align?: string
  slotName?: string
  headerSlotName?: string
  filters?: FilterVal[]
  children?: Header[]
}
interface mergeParam {
  row?: string[]
  col?: string[]
}
export interface Config {
  staticColumn?: StaticColumn[]
  singleChoiceHigHlight?: boolean
  border?: boolean
  searchProp?: string
  height?: number | string
  maxHeight?: number | string
  stripe?: boolean
  showSummary?: boolean
  ranksMerge?: {
    isMerge: boolean
    data: mergeParam
  }
  ignoreFirstLine?: boolean
}
export interface Pagination {
  total: number
  currentPage: number
  currentPageSize: number
  layout?: string
  pageSize?: number[]
  disabled?: boolean
  small?: boolean
  background?: boolean
}

export interface SpanMethodProps {
  row: InitData
  column: TableColumnCtx<InitData>
  rowIndex: number
  columnIndex: number
}
